const LOGIN = 'LOGIN'
const LOGOUT = 'LOGOUT'

export function auth(state={isAuth:false,user:'xuhongling'},action){
	switch (action.type){
		case LOGIN:
			return {...state, isAuth:true}
		case LOGOUT:
			return {...state, isAuth:false}
		default:
			return state
	}
}

// action
export function userLogin(){
	return {
		type: LOGIN
	}
}

export function userLogout(){
	return {
		type: LOGOUT
	}
}